package com.base.action;

import java.util.List;

import com.common.bean.Menuinfo;

public class MenuinfoSaveOrUpdateAction extends MenuinfoAbstractAction {

	private static final long serialVersionUID = 111193193808977741L;
	private Menuinfo menuinfo;
	
	private long menupid;
	
	private long menuid;
	
	private List<Menuinfo> menulist;
	
	@Override
	public String execute() throws Exception {
		menulist = menuService.findAllMenuinfo();
		return SUCCESS;
	}
	
	public String findToUpdateMenu() throws Exception {
		menuinfo = menuService.findMenuinfo(menuid);
		return SUCCESS;
	}
	
	public String addMenu() throws Exception {
//		menuinfo.setMenupid(menuid);
//		menulist = menuService.findAllMenuinfo();
		return SUCCESS;
	}

	public String doCreateMenu() throws Exception {
		this.menuService.addMenu(menuinfo);
		return SUCCESS;
	}
	
	public String doUpdateMenu() throws Exception {
		menuService.updateMenuinfo(menuinfo);
		return SUCCESS;
	}
	
	/**
	 * @return the menuinfo
	 */
	public Menuinfo getMenuinfo() {
		return menuinfo;
	}

	/**
	 * @param menuinfo the menuinfo to set
	 */
	public void setMenuinfo(Menuinfo menuinfo) {
		this.menuinfo = menuinfo;
	}

	/**
	 * @return the menupid
	 */
	public long getMenupid() {
		return menupid;
	}

	/**
	 * @param menupid the menupid to set
	 */
	public void setMenupid(long menupid) {
		this.menupid = menupid;
	}

	/**
	 * @return the menuid
	 */
	public long getMenuid() {
		return menuid;
	}

	/**
	 * @param menuid the menuid to set
	 */
	public void setMenuid(long menuid) {
		this.menuid = menuid;
	}

	/**
	 * @return the menulist
	 */
	public List<Menuinfo> getMenulist() {
		return menulist;
	}

	/**
	 * @param menulist the menulist to set
	 */
	public void setMenulist(List<Menuinfo> menulist) {
		this.menulist = menulist;
	}

}
